data <- fread("https://raw.githubusercontent.com/utnesp/Neuroblastoma_Biomarker_2018/master/docs/CPM.cumulative.freq.txt")
shapes = c(15, 16, 17, 0, 18, 3, 5, 2, 8, 24, 1, 25, 4, 7, 8, 9, 10, 26:30)
s <- data.frame(gene_biotype = data$gene_biotype[!duplicated(data$gene_biotype)], shape = shapes[1:length(unique(data$col))] , color = unique(data$col))
p1 <- ggplot(data, aes(CPM, CumulativeFrequency)) + geom_point(aes(shape = gene_biotype, color = gene_biotype,
text = paste("GENE: ", paste(external_gene_name, "(", ensembl_gene_id, ")", sep = ""), "\nGENE LENGTH (bp):", GeneLength)), size = 1) + theme_classic() + labs(x = "Average expression across cell lines (log2 CPM)", y = "Cumulative Relative Frequency", color='Biotype') + theme(legend.position = "right") +
scale_colour_manual(name = "Biotype",
labels = s$gene_biotype,
values = as.character(s$color)) +
scale_shape_manual(name = "Biotype",
labels = s$gene_biotype,
values = s$shape) +
theme(text = element_text(size = 10), axis.text = element_text(size = 10))
## Warning: Ignoring unknown aesthetics: text
ggplotly(p1 + theme(text = element_text(size = 10), axis.text = element_text(size = 10), legend.text = element_text(size = 10)), width = 1000, height = 1000)
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`